﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _2016._12.String
{
    class Program
    {
        static void Main(string[] args)
        {
            var numbers = new int[5] {1, 2, 3, 4, 5 };
            string numberList = string.Join(".", numbers);
            Console.WriteLine(numberList);

            string name = "Vasya";
            Console.WriteLine(name[0]);

            Console.WriteLine("Ditnjkgh lgkjflgd");

            string str = " Мама мыла раму";
            str = str.Trim();
            Console.WriteLine(str);

            int IndexOfa = str.IndexOf('а', 3, 5);
            int lastIndexofa = str.LastIndexOf('а');
            Console.WriteLine(IndexOfa);
            Console.WriteLine(lastIndexofa);

            string str1 = str.Substring(10);
            string str2 = str.Substring(2, 5);
            Console.WriteLine(str1);

            string[] strArr = str.Split(' ');

            foreach (var s in strArr)
            {
                Console.WriteLine(s);
            }

            string strReplace = str.Replace('а', '2');
            Console.WriteLine(strReplace);

            string strTest = " ";

            if (!(strTest == null))
            {
                Console.WriteLine("Not null");
            }

            Console.ReadKey();
        }
    }
}
